From e46c4d526d77916c00fff4fff3237b9c9d0d774d Mon Sep 17 00:00:00 2001
From: Robert Marko <robimarko@gmail.com>
Date: Fri, 23 Jun 2023 12:04:11 +0200
Subject: [PATCH 5/8] nss-dp: adapt to netif_napi_add() changes

netif_napi_add() removed the weight argument and just uses the default
NAPI_POLL_WEIGHT in background, so for those requiring custom weight use
netif_napi_add_weight() instead.

Signed-off-by: Robert Marko <robimarko@gmail.com>
---
 hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c | 4 ++++
 hal/dp_ops/syn_gmac_dp/syn_dp.c              | 5 +++++
 2 files changed, 9 insertions(+)

--- a/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
+++ b/hal/dp_ops/edma_dp/edma_v1/edma_data_plane.c
@@ -844,8 +844,12 @@ static int edma_register_netdevice(struc
 	 * NAPI add
 	 */
 	if (!edma_hw.napi_added) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0))
 		netif_napi_add(netdev, &edma_hw.napi, edma_napi,
 				NAPI_POLL_WEIGHT);
+#else
+		netif_napi_add(netdev, &edma_hw.napi, edma_napi);
+#endif
 		/*
 		 * Register the interrupt handlers and enable interrupts
 		 */
--- a/hal/dp_ops/syn_gmac_dp/syn_dp.c
+++ b/hal/dp_ops/syn_gmac_dp/syn_dp.c
@@ -189,8 +189,13 @@ static int syn_dp_if_init(struct nss_dp_
 	}
 
 	if (!dev_info->napi_added) {
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0))
 		netif_napi_add(netdev, &rx_info->napi_rx, syn_dp_napi_poll_rx, SYN_DP_NAPI_BUDGET_RX);
 		netif_napi_add(netdev, &tx_info->napi_tx, syn_dp_napi_poll_tx, SYN_DP_NAPI_BUDGET_TX);
+#else
+		netif_napi_add_weight(netdev, &rx_info->napi_rx, syn_dp_napi_poll_rx, SYN_DP_NAPI_BUDGET_RX);
+		netif_napi_add_weight(netdev, &tx_info->napi_tx, syn_dp_napi_poll_tx, SYN_DP_NAPI_BUDGET_TX);
+#endif
 
 		/*
 		 * Requesting irq. Set IRQ_DISABLE_UNLAZY flag, this flag
